package day05;

/*
 * Author: JacksonCoder
 * FileName: AbstractDemo
 * Version: 1.0.0
 * Date: 2025/4/12
 */
abstract class Shape{
    int x,y;

    public abstract double area();

    public void move(){
        System.out.println("Moving...");
    }
}

class Circle extends Shape{
    double r;
    public double area(){
        return r*r*3.14;
    }

    public void setR(double r){
        this.r = r;
    }

    public double getR(){
        return r;
    }
}

public class AbstractDemo {

    public static void main(String[] args) {
        Circle c = new Circle();
        c.setR(8.0);
        System.out.println("圆的面积：" + c.area());
    }

}
